package com.shop2cn.iapi.agentproducts.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.agentproducts.parameter.BatchGenWxCodeWhenAddCsBean;
import com.shop2cn.iapi.agentproducts.service.BatchGenWxCodeWhenAddCsCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.AgentUsers;
/**
*添加客服批量生成小程序图
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_BatchGenWxCodeWhenAddCs{
	private static BatchGenWxCodeWhenAddCsBean batchgenwxcodewhenaddcsBean;
	private static BatchGenWxCodeWhenAddCsCall batchgenwxcodewhenaddcsCall;

	//渠道商
	private static int rootUserId = AgentUsers.rootUserId;
	private static String rootUserName = "NickautoTest";
	//渠道商->代理商1
	private static int agentUserId1 = AgentUsers.agentUserId1;
	private static String agentUserName1 = "NickautoTest";
	//渠道商->代理商2
	private static int agentUserId2 = AgentUsers.agentUserId2;
	private static String agentUserName2 = "NickautoTest";

	//vip渠道
	private static int vipRootUserId = AgentUsers.vipRootUserId;
	private static String vipRootUserName = "NickautoTest";
	private static int csId = AgentUsers.csId;
	//vip渠道->代理
	private static int vipAgentUserId1 = AgentUsers.vipAgentUserId1;
	private static String vipAgentUserName1 = "dgsq408897016";
	private static int csId1 = AgentUsers.csId1;
	//vip渠道->代理->代理
	private static int vipAgentUserId2 = AgentUsers.vipAgentUserId2;
	private static String vipAgentUserName2 = "NickautoTest";
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("添加客服批量生成小程序图");
	}

	@Before
	public void caseUp() {
		batchgenwxcodewhenaddcsBean=new BatchGenWxCodeWhenAddCsBean();
		batchgenwxcodewhenaddcsCall=new BatchGenWxCodeWhenAddCsCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(batchgenwxcodewhenaddcsCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	/**
	 * job 异步
	 */
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_BatchGenWxCodeWhenAddCs_01() {
		Logger.start(true,"添加客服批量生成小程序图");
		try {
			batchgenwxcodewhenaddcsBean.setMchId(vipRootUserId);
			batchgenwxcodewhenaddcsBean.setCsId(csId);
			batchgenwxcodewhenaddcsCall.setData(batchgenwxcodewhenaddcsBean);
			batchgenwxcodewhenaddcsCall.callService();			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	//继承代理商生成二维码逻辑变更，继承代理商的商品要用渠道商ID获取	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_BatchGenWxCodeWhenAddCs_022() {
		Logger.start(true,"添加客服批量生成小程序图");
		try {

			batchgenwxcodewhenaddcsBean.setMchId(vipRootUserId);
			batchgenwxcodewhenaddcsBean.setCsId(csId);
			batchgenwxcodewhenaddcsCall.setData(batchgenwxcodewhenaddcsBean);
			batchgenwxcodewhenaddcsCall.callService();			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	
}